\(\int \frac {\sin ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx\) [29]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (warning: unable to verify)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 71 \[ \int \frac {\sin ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\sqrt {b} (a+b) \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{a^{5/2} f}-\frac {(a+b) \cos (e+f x)}{a^2 f}+\frac {\cos ^3(e+f x)}{3 a f} \]

[Out]

-(a+b)*cos(f*x+e)/a^2/f+1/3*cos(f*x+e)^3/a/f+(a+b)*arctan(cos(f*x+e)*a^(1/2)/b^(1/2))*b^(1/2)/a^(5/2)/f

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {4218, 470, 327, 211} \[ \int \frac {\sin ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\sqrt {b} (a+b) \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{a^{5/2} f}-\frac {(a+b) \cos (e+f x)}{a^2 f}+\frac {\cos ^3(e+f x)}{3 a f} \]

[In]

Int[Sin[e + f*x]^3/(a + b*Sec[e + f*x]^2),x]

[Out]

(Sqrt[b]*(a + b)*ArcTan[(Sqrt[a]*Cos[e + f*x])/Sqrt[b]])/(a^(5/2)*f) - ((a + b)*Cos[e + f*x])/(a^2*f) + Cos[e
+ f*x]^3/(3*a*f)

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 470

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(b*e*(m + n*(p + 1) + 1))), x] - Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m +
 n*(p + 1) + 1)), Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0]
 && NeQ[m + n*(p + 1) + 1, 0]

Rule 4218

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = F
reeFactors[Cos[e + f*x], x]}, Dist[-ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*((b + a*(ff*x)^n)^p/(ff*x)^(n*p
)), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n] && IntegerQ[p
]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {x^2 \left (1-x^2\right )}{b+a x^2} \, dx,x,\cos (e+f x)\right )}{f} \\ & = \frac {\cos ^3(e+f x)}{3 a f}-\frac {(a+b) \text {Subst}\left (\int \frac {x^2}{b+a x^2} \, dx,x,\cos (e+f x)\right )}{a f} \\ & = -\frac {(a+b) \cos (e+f x)}{a^2 f}+\frac {\cos ^3(e+f x)}{3 a f}+\frac {(b (a+b)) \text {Subst}\left (\int \frac {1}{b+a x^2} \, dx,x,\cos (e+f x)\right )}{a^2 f} \\ & = \frac {\sqrt {b} (a+b) \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{a^{5/2} f}-\frac {(a+b) \cos (e+f x)}{a^2 f}+\frac {\cos ^3(e+f x)}{3 a f} \\ \end{align*}

Mathematica [C] (warning: unable to verify)

Result contains complex when optimal does not.

Time = 2.21 (sec) , antiderivative size = 376, normalized size of antiderivative = 5.30 \[ \int \frac {\sin ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {(a+2 b+a \cos (2 (e+f x))) \left (3 \left (a^2+8 a b+8 b^2\right ) \arctan \left (\frac {\left (-\sqrt {a}-i \sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2}\right ) \sin (e) \tan \left (\frac {f x}{2}\right )+\cos (e) \left (\sqrt {a}-\sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2} \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {b}}\right )+3 \left (a^2+8 a b+8 b^2\right ) \arctan \left (\frac {\left (-\sqrt {a}+i \sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2}\right ) \sin (e) \tan \left (\frac {f x}{2}\right )+\cos (e) \left (\sqrt {a}+\sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2} \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {b}}\right )-3 a^2 \arctan \left (\frac {\sqrt {a}-\sqrt {a+b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {b}}\right )-3 a^2 \arctan \left (\frac {\sqrt {a}+\sqrt {a+b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {b}}\right )+4 \sqrt {a} \sqrt {b} \cos (e+f x) (-5 a-6 b+a \cos (2 (e+f x)))\right ) \sec ^2(e+f x)}{48 a^{5/2} \sqrt {b} f \left (a+b \sec ^2(e+f x)\right )} \]

[In]

Integrate[Sin[e + f*x]^3/(a + b*Sec[e + f*x]^2),x]

[Out]

((a + 2*b + a*Cos[2*(e + f*x)])*(3*(a^2 + 8*a*b + 8*b^2)*ArcTan[((-Sqrt[a] - I*Sqrt[a + b]*Sqrt[(Cos[e] - I*Si
n[e])^2])*Sin[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a] - Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2]*Tan[(f*x)/2]))/Sqrt[
b]] + 3*(a^2 + 8*a*b + 8*b^2)*ArcTan[((-Sqrt[a] + I*Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2])*Sin[e]*Tan[(f*x)/
2] + Cos[e]*(Sqrt[a] + Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2]*Tan[(f*x)/2]))/Sqrt[b]] - 3*a^2*ArcTan[(Sqrt[a]
 - Sqrt[a + b]*Tan[(e + f*x)/2])/Sqrt[b]] - 3*a^2*ArcTan[(Sqrt[a] + Sqrt[a + b]*Tan[(e + f*x)/2])/Sqrt[b]] + 4
*Sqrt[a]*Sqrt[b]*Cos[e + f*x]*(-5*a - 6*b + a*Cos[2*(e + f*x)]))*Sec[e + f*x]^2)/(48*a^(5/2)*Sqrt[b]*f*(a + b*
Sec[e + f*x]^2))

Maple [A] (verified)

Time = 0.49 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.94

method result size
derivativedivides \(\frac {\frac {\frac {a \cos \left (f x +e \right )^{3}}{3}-\cos \left (f x +e \right ) a -b \cos \left (f x +e \right )}{a^{2}}+\frac {b \left (a +b \right ) \arctan \left (\frac {a \cos \left (f x +e \right )}{\sqrt {a b}}\right )}{a^{2} \sqrt {a b}}}{f}\) \(67\)
default \(\frac {\frac {\frac {a \cos \left (f x +e \right )^{3}}{3}-\cos \left (f x +e \right ) a -b \cos \left (f x +e \right )}{a^{2}}+\frac {b \left (a +b \right ) \arctan \left (\frac {a \cos \left (f x +e \right )}{\sqrt {a b}}\right )}{a^{2} \sqrt {a b}}}{f}\) \(67\)
risch \(-\frac {3 \,{\mathrm e}^{i \left (f x +e \right )}}{8 a f}-\frac {{\mathrm e}^{i \left (f x +e \right )} b}{2 a^{2} f}-\frac {3 \,{\mathrm e}^{-i \left (f x +e \right )}}{8 a f}-\frac {{\mathrm e}^{-i \left (f x +e \right )} b}{2 a^{2} f}+\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right )}{2 a^{2} f}+\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right ) b}{2 a^{3} f}-\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right )}{2 a^{2} f}-\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right ) b}{2 a^{3} f}+\frac {\cos \left (3 f x +3 e \right )}{12 f a}\) \(275\)

[In]

int(sin(f*x+e)^3/(a+b*sec(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/f*(1/a^2*(1/3*a*cos(f*x+e)^3-cos(f*x+e)*a-b*cos(f*x+e))+b*(a+b)/a^2/(a*b)^(1/2)*arctan(a*cos(f*x+e)/(a*b)^(1
/2)))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 154, normalized size of antiderivative = 2.17 \[ \int \frac {\sin ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\left [\frac {2 \, a \cos \left (f x + e\right )^{3} + 3 \, {\left (a + b\right )} \sqrt {-\frac {b}{a}} \log \left (-\frac {a \cos \left (f x + e\right )^{2} + 2 \, a \sqrt {-\frac {b}{a}} \cos \left (f x + e\right ) - b}{a \cos \left (f x + e\right )^{2} + b}\right ) - 6 \, {\left (a + b\right )} \cos \left (f x + e\right )}{6 \, a^{2} f}, \frac {a \cos \left (f x + e\right )^{3} + 3 \, {\left (a + b\right )} \sqrt {\frac {b}{a}} \arctan \left (\frac {a \sqrt {\frac {b}{a}} \cos \left (f x + e\right )}{b}\right ) - 3 \, {\left (a + b\right )} \cos \left (f x + e\right )}{3 \, a^{2} f}\right ] \]

[In]

integrate(sin(f*x+e)^3/(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

[1/6*(2*a*cos(f*x + e)^3 + 3*(a + b)*sqrt(-b/a)*log(-(a*cos(f*x + e)^2 + 2*a*sqrt(-b/a)*cos(f*x + e) - b)/(a*c
os(f*x + e)^2 + b)) - 6*(a + b)*cos(f*x + e))/(a^2*f), 1/3*(a*cos(f*x + e)^3 + 3*(a + b)*sqrt(b/a)*arctan(a*sq
rt(b/a)*cos(f*x + e)/b) - 3*(a + b)*cos(f*x + e))/(a^2*f)]

Sympy [F(-1)]

Timed out. \[ \int \frac {\sin ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\text {Timed out} \]

[In]

integrate(sin(f*x+e)**3/(a+b*sec(f*x+e)**2),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.89 \[ \int \frac {\sin ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\frac {3 \, {\left (a b + b^{2}\right )} \arctan \left (\frac {a \cos \left (f x + e\right )}{\sqrt {a b}}\right )}{\sqrt {a b} a^{2}} + \frac {a \cos \left (f x + e\right )^{3} - 3 \, {\left (a + b\right )} \cos \left (f x + e\right )}{a^{2}}}{3 \, f} \]

[In]

integrate(sin(f*x+e)^3/(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

1/3*(3*(a*b + b^2)*arctan(a*cos(f*x + e)/sqrt(a*b))/(sqrt(a*b)*a^2) + (a*cos(f*x + e)^3 - 3*(a + b)*cos(f*x +
e))/a^2)/f

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.20 \[ \int \frac {\sin ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {{\left (a b + b^{2}\right )} \arctan \left (\frac {a \cos \left (f x + e\right )}{\sqrt {a b}}\right )}{\sqrt {a b} a^{2} f} + \frac {a^{2} f^{5} \cos \left (f x + e\right )^{3} - 3 \, a^{2} f^{5} \cos \left (f x + e\right ) - 3 \, a b f^{5} \cos \left (f x + e\right )}{3 \, a^{3} f^{6}} \]

[In]

integrate(sin(f*x+e)^3/(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

(a*b + b^2)*arctan(a*cos(f*x + e)/sqrt(a*b))/(sqrt(a*b)*a^2*f) + 1/3*(a^2*f^5*cos(f*x + e)^3 - 3*a^2*f^5*cos(f
*x + e) - 3*a*b*f^5*cos(f*x + e))/(a^3*f^6)

Mupad [B] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.07 \[ \int \frac {\sin ^3(e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {{\cos \left (e+f\,x\right )}^3}{3\,a\,f}-\frac {\cos \left (e+f\,x\right )\,\left (\frac {b}{a^2}+\frac {1}{a}\right )}{f}+\frac {\sqrt {b}\,\mathrm {atan}\left (\frac {\sqrt {a}\,\sqrt {b}\,\cos \left (e+f\,x\right )\,\left (a+b\right )}{b^2+a\,b}\right )\,\left (a+b\right )}{a^{5/2}\,f} \]

[In]

int(sin(e + f*x)^3/(a + b/cos(e + f*x)^2),x)

[Out]

cos(e + f*x)^3/(3*a*f) - (cos(e + f*x)*(b/a^2 + 1/a))/f + (b^(1/2)*atan((a^(1/2)*b^(1/2)*cos(e + f*x)*(a + b))
/(a*b + b^2))*(a + b))/(a^(5/2)*f)